﻿using MB.Orm.DB;
using MB.RuleBase.Common;
using Model;
using Public.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Business.Service
{
    public class BProjectManage
    {
        public BProjectManage() { }

        /// <summary>
        /// 查询项目信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="total"></param>
        /// <param name="parValues"></param>
        /// <returns></returns>
        public List<OAProjectManage> GetOAProjectManageInfo(int pageIndex, int pageSize, out int total, params object[] parValues)
        {
            using (var DbScope = new OperationDatabaseScope(new OperationDatabaseContext("NewWeb")))
            {
                List<OAProjectManage> list = PagedDatabaseExcuteByXmlHelper.NewInstance.GetPagedObjectsByXml3<OAProjectManage>
                                                ("OAProjectManage", "GetOAProjectManageInfo", pageIndex, pageSize, out total, parValues);
                return list;
            }
        }

        /// <summary>
        /// 新增项目信息
        /// </summary>
        /// <param name="oAFileManage"></param>
        /// <returns></returns>
        public int InsertOAProjectManage(OAProjectManage oAProjectManage)
        {
            return DatabaseExcuteByXmlHelper.NewInstance.ExecuteNonQueryByEntity<OAProjectManage>("OAProjectManage", "InsertOAProjectManage", oAProjectManage);
        }
    }
}
